package MD2Model;

/**
 * 	MD2Header class hold information of MD2' header
 *  It holds the model's basic dimensional information
 *  
 *  The ident filed identifies the model you are loading. It must be "IDP2" for MD2 model
 *  The skinwidth and skinheight fields specify the width and height of the textures
 *  The framesize field tell you the size of each frame in bytes.
 *  The num_skins field tells you how many skins are available for the model, the name of
 * textures will be listed at the location specified by offset_skins field.
 * 	The num_vertices field specifies the total number of vertices of the model, which is the sum
 * of the number of vertices in each frame.
 * 	The num_st field holds the number of texture coordinates
 * 	The num_tris field tells you how many triangles in the model.
 * 	The num_glcmds field specifies the number of OpenGL commands that are stored at the
 * location offsetGLcmds in MD2 file.
 * 	The num_frame field tell you the number of frames of animation that the model has available.
 * 
 * 	The offset session hold the location of data in MD2 file.
 */
public class MD2Header {
	int ident; 		/* magic number: "IDP2" */
	int version; 	/* version: must be 8 */

	int skinwidth; 		/* texture width */
	int skinheight; 	/* texture height */

	int framesize; 		/* size in bytes of a frame */

	int num_skins; 		/* number of skins */
	int num_vertices; 	/* number of vertices per frame */
	int num_st; 		/* number of texture coordinates */
	int num_tris; 		/* number of triangles */
	int num_glcmds;		/* number of opengl commands */
	int num_frames; 	/* number of frames */

	int offset_skins; 	/* offset skin data */
	int offset_st; 		/* offset texture coordinate data */
	int offset_tris;	/* offset triangle data */
	int offset_frames;	/* offset frame data */
	int offset_glcmds;	/* offset OpenGL command data */
	int offset_end; 	/* offset end of file */

	public void SetValue(int _ident, int _version, int _skinwidth, int _skinheight,
			int _framesize, int _num_skins, int _num_vertices, int _num_st,
			int _num_tris, int _num_glcmds, int _num_frames, int _offset_skins,
			int _offset_st, int _offset_tris, int _offset_frames,
			int _offset_glcmds, int _offset_end) {
		
		/**
		 * Set values for MD2Header' informations
		 * The values will be read direct from MD2 file.
		 */
		
		ident = _ident;
		version = _version;

		skinwidth = _skinwidth;
		skinheight = _skinheight;

		framesize = _framesize;

		num_skins = _num_skins;
		num_vertices = _num_vertices;
		num_st = _num_st;
		num_tris = _num_tris;
		num_glcmds = _num_glcmds;
		num_frames = _num_frames;

		offset_skins = _offset_skins;
		offset_st = _offset_st;
		offset_tris = _offset_tris;
		offset_frames = _offset_frames;
		offset_glcmds = _offset_glcmds;
		offset_end = _offset_end;
	}
}
